<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>我的微信</title>
    <script src="/js/jquery-3.2.1.js"></script>
</head>
<body>
<span>规则内容</span>
<div>

    <div>
        <span th:text="${weCont.id}" hidden></span><input id="id" name="id" th:value="${weCont.id}" disabled hidden/><br/>
        <span>关键字：</span><input id="name" name="name" th:value="${weCont.name}"/>
        <span>内容：</span><input id="content" name="content" th:value="${weCont.content}"/>
        <span>时间：</span><span th:text="${weCont.date}"></span>
        <button id="button">提交</button>
    </div>
</div>
</body>
<script>
$(function (){
    $("#button").click(function(){
        var weCont={
            "id": $("#id").val(),
            "name" : $("#name").val(),
            "content" : $("#content").val()
        };

        $.ajax({
            type: 'post',
            url: "/wecont/update",
            data : weCont,
            success: function(data){
                window.location.href = "/wecont";
            },
            error:function(data){
                alert("出错了！！:"+data.msg);
            }
        });
        return false;
    });

});
</script>
</html>